package com.dragon.repository.domain.dto;

import com.baomidou.mybatisplus.annotation.TableField;
import com.dragon.common.util.BeanUtils;
import com.dragon.repository.entity.VendorBillSon;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;


/**
 * @author sy
 */
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
public class VendorBillSonDTO {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "自增id")
    private Integer id;

    @ApiModelProperty(value = "外发主表id")
    private Integer schedulingOutId;

    @ApiModelProperty(value = "供应商id")
    private Integer vendorId;

    @ApiModelProperty(value = "外发金额")
    private Double outMoney;

    @ApiModelProperty(value = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;

    @ApiModelProperty(value = "供应商账单id")
    private Integer vendorBillId;

    @ApiModelProperty(value = "是否生成供应商账单 0否 1是")
    private Integer billStatus;

    @ApiModelProperty(value = "供应商名称")
    private String vendorName;



    public VendorBillSonDTO() {}

    public VendorBillSonDTO(VendorBillSon entity) {
        BeanUtils.copyProperties(entity,this);
    }

    public static VendorBillSonDTO convert(VendorBillSon entity) {
        return new VendorBillSonDTO(entity);
    }

    public static List<VendorBillSonDTO> convertList(List<VendorBillSon> list) {
        List<VendorBillSonDTO> resultList = new ArrayList<>();
        for (VendorBillSon entity : list) {
            resultList.add(new VendorBillSonDTO(entity));
        }
        return resultList;
    }}
